/*
 * @Author: 一日看尽长安花
 * @since: 2019-08-28 14:27:17
 * @LastEditTime: 2019-08-28 14:27:17
 * @LastEditors: 一日看尽长安花
 * @Description:
 */
import Vue from 'vue';
import Router from 'vue-router';

Vue.use(Router);

export default new Router({
  mode: 'history',
  base: process.env.BASE_URL,
  routes: [
    {
      path: '/test',
      name: 'test',
      component: () => import('@/views/demo/3')
    },
    {
      path: '/table',
      name: 'table',
      component: () => import('@/views/demo/2')
    },
    {
      path: '/home',
      name: 'home',
      component: () => import('@/views/demo/1/Home.vue'),
      children: [
        {
          // 这里的path没有以 / 开始，所以在 <router-link to=''></router-link> 中的路径与等于上级的 / + 这个子路由的path => / + about=> /about
          path: '/about',
          name: 'about',
          // route level code-splitting
          // this generates a separate chunk (about.[hash].js) for this route
          // which is lazy-loaded when the route is visited.
          component: () => import('@/views/demo/1/About.vue')
        },
        {
          // 这里的path以  /  开始，所以在 <router-link to=''></router-link> 中的路径与这里path完全一致
          path: '/three-gui',
          name: 'gui',
          // route level code-splitting
          // this generates a separate chunk (about.[hash].js) for this route
          // which is lazy-loaded when the route is visited.
          component: () => import('@/views/demo/1/GUI.vue')
        },
        {
          path: '/elspa',
          name: 'elspa',
          // route level code-splitting
          // this generates a separate chunk (about.[hash].js) for this route
          // which is lazy-loaded when the route is visited.
          component: () => import('@/views/demo/1/ElementDemo.vue')
        }
      ]
    }
  ]
});
